// Widgets/PetTravelDetail/PetTravelDetailBannerWidget/PetTravelDetailBannerWidget.js
//获取应用实例
const app = getApp()
const assetsAddress = app.globalData.global.assetsIp + '/' + app.globalData.global.assetsName;
Component({

  /**
   * 组件的属性列表
   */
  properties: {
    bannerList: {
      type: Array,
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    assetsAddress: assetsAddress,
    index: 1,
    current: 0,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    showPic(e){
      let item = e.target.dataset.item||e.currentTarget.dataset.item;
      this.triggerEvent('showBannerPic',JSON.stringify(item))
    },
    back(){
      wx.navigateBack();
    },
    onChange(e){
      console.log(e,'e')
      this.setData({
        index: e.detail.current + 1,
      })
    }
  }
})